Object Storage 성능 측정 및 NAS 비교 분석

문제 상황

기존 NAS에서 Object Storage로 이미지/비디오 파일을 이전했으나 여전히 "느리다"는 피드백이 발생하여 객관적인 성능 측정이 필요한 상황

주요 URL 구조

기존 NAS: [기존 웹서버 URL]/sites/www/images/common/
신규 OBS: [오브젝트 스토리지 URL]/www/images/common/

연결성 검증 결과

Object Storage 기본 연결 상태

파일 존재 확인

측정 방법별 성능 비교

1. HEAD 요청 방식 (메타데이터만)

Invoke-WebRequest -Uri $url -Method Head -TimeoutSec 30

결과: 평균 50-60ms
특징: 서버 응답성만 측정, 실제 사용자 체감과 차이

2. GET 요청 방식 (메모리 로드)

$response = Invoke-WebRequest -Uri $url -Method Get -TimeoutSec 60

결과: 파일 크기에 따라 가변적
특징: 전체 파일을 메모리에 로드, 큰 파일일수록 오버헤드 발생

3. OutFile 방식 (브라우저와 가장 비슷한 다운로드 속도 테스트)

$ProgressPreference = 'SilentlyContinue'
$startTime = Get-Date
Invoke-WebRequest -Uri $url -OutFile $filePath
$endTime = Get-Date
$downloadTime = ($endTime - $startTime).TotalSeconds

결과: songwon.mp4 (6.2MB) 파일 0.7초 완료
특징: 브라우저 다운로드와 가장 유사한 방식, 실제 사용자 체감 속도와 일치

핵심 발견사항

Object Storage 캐시 동작 분석

실제 다운로드 성능 (브라우저와 동일한 방식)

파일: songwon.mp4
크기: 6.2MB
소요 시간: 0.7초
평균 속도: 70.86 Mbps

성능 측정 스크립트

전체 파일 테스트용

function Test-AllOBSFiles {
    $imageFiles = @(
        # ... 전체 리스트
    )
    
    Write-Host "[이미지 파일]" -ForegroundColor Cyan
    foreach ($file in $imageFiles) {
        $url = "[오브젝트 스토리지 URL]/www/images/common/$file"
        
        try {
            $sw = [System.Diagnostics.Stopwatch]::StartNew()
            Invoke-WebRequest -Uri $url -Method Head -TimeoutSec 30 | Out-Null
            $sw.Stop()
            Write-Host "$file : $($sw.ElapsedMilliseconds)ms" -ForegroundColor Green
        }
        catch {
            Write-Host "$file : 실패" -ForegroundColor Red
        }
    }
}

브라우저와 가장 비슷한 실제 다운로드 속도 측정용

function Test-RealDownload {
    param([string]$fileName = "songwon.mp4")
    
    $ProgressPreference = 'SilentlyContinue'  # 진행률 표시 비활성화
    $url = "[오브젝트 스토리지 URL]/www/video/$fileName"
    $filePath = ".\$fileName"
    
    Write-Host "다운로드 시작..."
    $startTime = Get-Date
    
    try {
        Invoke-WebRequest -Uri $url -OutFile $filePath
    }
    catch {
        Write-Host "오류 발생: $_.Exception.Message"
        return
    }
    
    $endTime = Get-Date
    $downloadTime = ($endTime - $startTime).TotalSeconds
    
    if ($downloadTime -gt 0) {
        $fileSize = (Get-Item $filePath).Length
        $speedBytesPerSec = $fileSize / $downloadTime
        $speedMbps = ($speedBytesPerSec * 8) / 1MB
        
        Write-Host "다운로드 완료!"
        Write-Host "------------------------"
        Write-Host "파일 크기: $($fileSize / 1MB) MB"
        Write-Host "소요 시간: $downloadTime 초"
        Write-Host "평균 속도: $($speedMbps.ToString('N2')) Mbps"
        Write-Host "------------------------"
    }
}

NAS vs Object Storage 비교용 (브라우저와 동일한 방식)

function Compare-RealDownload {
    $testFiles = @("")
    
    foreach ($file in $testFiles) {
        Write-Host "[$file]" -ForegroundColor Cyan
        
        # NAS 실제 다운로드
        $nasUrl = "[기존 웹서버 URL]/sites/www/images/common/$file"
        try {
            $sw1 = [System.Diagnostics.Stopwatch]::StartNew()
            $response1 = Invoke-WebRequest -Uri $nasUrl -Method Get -TimeoutSec 60
            $sw1.Stop()
            $size1 = [math]::Round($response1.Content.Length/1KB, 2)
            Write-Host "  NAS: $($sw1.ElapsedMilliseconds)ms ($size1 KB)" -ForegroundColor White
        }
        catch {
            Write-Host "  NAS: 실패" -ForegroundColor Red
        }
        
        # Object Storage 실제 다운로드
        $obsUrl = "[오브젝트 스토리지 URL]/www/images/common/$file"
        try {
            $sw2 = [System.Diagnostics.Stopwatch]::StartNew()
            $response2 = Invoke-WebRequest -Uri $obsUrl -Method Get -TimeoutSec 60
            $sw2.Stop()
            $size2 = [math]::Round($response2.Content.Length/1KB, 2)
            Write-Host "  OBS: $($sw2.ElapsedMilliseconds)ms ($size2 KB)" -ForegroundColor White
        }
        catch {
            Write-Host "  OBS: 실패" -ForegroundColor Red
        }
        
        Write-Host ""
    }
}

결론 및 권장사항

주요 결론

  1. Object Storage 자체 성능은 양호함 (70+ Mbps)
  2. HEAD 요청으로는 성능 차이 측정 어려움
  3. OutFile 방식이 브라우저와 가장 비슷한 다운로드 속도 테스트 방법
  4. 실제 사용자 체감과 일치하는 측정 결과 확보

권장사항

  1. 성능 비교 시 OutFile 방식 사용 (브라우저와 동일한 조건)
  2. 브라우저 캐싱 정책 검토 필요
  3. CDN 도입 검토 (추가 성능 향상)
  4. 압축 최적화 적용 고려

보고서 작성 가이드라인

측정 방식별 적용 시나리오